package com.guc.coroutines

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.fragment.app.commit
import androidx.fragment.app.replace
import com.guc.coroutines.databinding.ActivityFragmentDemoBinding
import com.guc.coroutines.databinding.ActivityMainBinding
import com.guc.coroutines.databinding.FragmentFirstBinding
import com.guc.coroutines.fg.FirstFragment
import com.guc.gviewbinding.inflate

class FragmentDemoActivity : AppCompatActivity() {
    private val mainBinding: ActivityFragmentDemoBinding by inflate()
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mainBinding
        supportFragmentManager.commit {
            setReorderingAllowed(true)
//            addToBackStack(null)
            add(R.id.fragment_container,FirstFragment.newInstance("参数1","参数2"))
//            replace<FirstFragment>(R.id.fragment_container)
        }
    }
}